package com.huike.report.service.impl;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huike.clues.domain.TbActivity;
import com.huike.clues.mapper.SysDictDataMapper;
import com.huike.clues.mapper.TbActivityMapper;
import com.huike.contract.mapper.TbContractMapper;
import com.huike.report.service.IReportService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
@RequiredArgsConstructor
public class IReportServiceImpl implements IReportService {

   /* private final TbContractMapper contractMapper;
    private final SysDictDataMapper sysDictDataMapper;

    private final TbActivityMapper activityMapper;

    *//**
     * 渠道统计
     *
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     *//*
    @Override
    public List<Map<String,Object>> chanelStatistics(String beginCreateTime, String endCreateTime) {
        List<Map<String, Object>> data= contractMapper.chanelStatistics(beginCreateTime,endCreateTime);
        for (Map<String, Object> datum : data) {
            String subjectValue= (String) datum.get("channel");
            String lable=  sysDictDataMapper.selectDictLabel("clues_item",subjectValue);
            datum.put("channel",lable);
        }
        return data;
    }

    *//**
     * 渠道统计-活动统计
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     *//*
    @Override
    public List<Map<String,Object>> activityStatistics(String beginCreateTime, String endCreateTime) {
        List<Map<String, Object>> data= contractMapper.activityStatistics(beginCreateTime,endCreateTime);
        for (Map<String, Object> datum : data) {
            Long activityId= (Long) datum.get("activity_id");
            TbActivity tbActivity = activityMapper.selectTbActivityById(activityId);
            if(tbActivity==null){
                datum.put("activity", "其他");
            }else{
                datum.put("activity", tbActivity.getName());
            }
        }

        return data;
    }*/
}
